package com.hayato.demo.dao;

import javax.jdo.PersistenceManager;

import org.datanucleus.exceptions.NucleusObjectNotFoundException;

import com.hayato.demo.client.Info.CustomerInfo;
import com.hayato.demo.utils.PMF;

public class CustomerDao {

	public CustomerInfo findCustomerById( Long customerId ) {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		
		try {
			return pm.getObjectById( CustomerInfo.class, customerId );
		} catch( NucleusObjectNotFoundException e ) { 
			return null;
		} catch( Exception e ) {
			return null;
		} finally {
			pm.close();
		}
	}
	
//	public CustomerInfo findCustomerByName( String name ) {
//		
//	}

}
